﻿using PPSMS_DAL;
using PPSMS_Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PPSMS_BLL
{
    public class StationStatistics_BLL
    {
        private StationStatistics_DAL _stationStatistics_DAL = new();

        public void Insert(StationStatistics stationStatistics)
        {
            _stationStatistics_DAL.Insert(stationStatistics);
        }
        public List<StationStatistics> SelectAll()
        {
            return _stationStatistics_DAL.SelectAll();
        }

        public DataTable SelectByDateBLL(string date, string table)
        {
            return _stationStatistics_DAL.SelectByDateDAL(date, table);
        }

        public DataTable SelectByDatesBLL(string date, string table)
        {
            date = $"'{date}'||SUBSTR(DATE,{date.Length+1},3)";
            return _stationStatistics_DAL.SelectByDatesDAL(date, table);
        }

    }
}
